<?php
class ModelCatalogdanhmuchotro extends Model {
	public function getdanhmuchotro($danhmuchotro_id) {
		$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "danhmuchotro d LEFT JOIN " . DB_PREFIX . "danhmuchotro_info di ON (d.danhmuchotro_id = di.danhmuchotro_id) WHERE danhmuchotro_id = '" . (int)$danhmuchotro_id . "' AND di.language_id = '" . (int)$this->config->get('config_language_id') . "'");
		
		return $query->row;	
	}
	
	public function getdanhmuchotros() {

			$sql = "SELECT * FROM " . DB_PREFIX . "danhmuchotro d LEFT JOIN " . DB_PREFIX . "danhmuchotro_info di ON (d.danhmuchotro_id = di.danhmuchotro_id) WHERE di.language_id = '" . (int)$this->config->get('config_language_id') . "' ORDER BY sort_order";
			$query = $this->db->query($sql);
			
			//echo "<pre>";print_r($query);die();

			$danhmuchotro = $query->rows;
		 
		return $danhmuchotro;
	} 
}
?>